import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Login',
      component: () => import('../views/Login.vue'),
    },
    {
      path: '/home',
      name: 'Home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'About',
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/Main',
      name: 'Main',
      component: () => import('../views/Main.vue'),
      children: [
        // 系统管理模块
        {
          path: 'Organize',
          name: 'Organize',
          component: () => import('../views/System/Organize.vue'),
        },
        {
          path: 'Post',
          name: 'Post',
          component: () => import('../views/System/Post.vue'),
        },
        {
          path: 'User',
          name: 'User',
          component: () => import('../views/System/User.vue'),
        },
        {
          path: 'Role',
          name: 'Role',
          component: () => import('../views/System/Role.vue'),
        },
        {
          path: 'system-05',
          name: 'Permission',
          component: () => import('../views/System/Permission.vue'),
        },
        
        // 库存管理模块
        {
          path: 'Inventoryreport',
          name: 'Inventoryreport',
          component: () => import('../views/InventoryManagement/Inventoryreport.vue'),
        },
        {
          path: 'InboundandOutboundDetails',
          name: 'InboundandOutboundDetails',
          component: () => import('../views/InventoryManagement/InboundandOutboundDetails.vue'),
        },
        {
          path:'DifyAi',
          name:'DifyAi',
          component:()=>import('../views/WorkOrder/DifyAi.vue')
        },
         {
          path:'BomInfo',
          name:'BomInfo',
          component:()=>import('../views/Product/BOM/BomInfo.vue'),
        },
        {
          path:'BomDetail',
          name:'BomDetail',
          component:()=>import('../views/Product/BOM/BomDetail.vue'),
        },
        // 物料管理路由
        {
          path:'MaterialInfo',
          name:'MaterialInfo',
          component:()=>import('../views/Product/Material/MaterialInfo.vue'),
        },
        {
          path:'MaterialDetail',
          name:'MaterialDetail',
          component:()=>import('../views/Product/Material/MaterialDetail.vue'),
        },
        // 产品管理路由
        {
          path:'ProductInfo',
          name:'ProductInfo',
          component:()=>import('../views/Product/Product/ProductInfo.vue'),
        },
        {
          path:'ProductDetail',
          name:'ProductDetail',
          component:()=>import('../views/Product/Product/ProductDetail.vue'),
        },
        // 工艺路线管理路由
        {
          path:'ProcessRouteInfo',
          name:'ProcessRouteInfo',
          component:()=>import('../views/Product/ProcessRoute/ProcessRouteInfo.vue'),
        },
        {
          path:'ProcessRouteDetail',
          name:'ProcessRouteDetail',
          component:()=>import('../views/Product/ProcessRoute/ProcessRouteDetail.vue'),
        },
        // 排程管理路由
        {
          path:'CalendarList',
          name:'CalendarList',
          component:()=>import('../views/Scheduling/CalendarList.vue'),
        },
        {
          path:'ScheduleAdd',
          name:'ScheduleAdd',
          component:()=>import('../views/Scheduling/ScheduleAdd.vue'),
        },
        {
          path:'ScheduliList',
          name:'ScheduliList',
          component:()=>import('../views/Scheduling/ScheduliList.vue'),
        },
        {
          path:'ShiftList',
          name:'ShiftList',
          component:()=>import('../views/Scheduling/ShiftList.vue'),
        },
        {
          path:'TeamList',
          name:'TeamList',
          component:()=>import('../views/Scheduling/TeamList.vue'),
        },
        {
          path:'TeamMemberList',
          name:'TeamMemberList',
          component:()=>import('../views/Scheduling/TeamMemberList.vue'),
        },
        {
          path: 'board-01',
          name: 'ProductionDashboard',
          component: () => import('../views/Dashboard/ProductionDashboard.vue'),
        },
        {
          path: 'board-02',
          name: 'QualityDashboard',
          component: () => import('../views/Dashboard/ProductionDashboard.vue'), // 暂时使用同一个组件
        },
        {
          path: 'board-03',
          name: 'WarehouseDashboard',
          component: () => import('../views/Dashboard/ProductionDashboard.vue'), // 暂时使用同一个组件
        },
        {
          path: 'board-04',
          name: 'DeviceDashboard',
          component: () => import('../views/Dashboard/ProductionDashboard.vue'), // 暂时使用同一个组件
        },
        {
          path: 'board-05',
          name: 'ComprehensiveDashboard',
          component: () => import('../views/Dashboard/ProductionDashboard.vue'), // 暂时使用同一个组件
        },
        
        // 客户供应商模块
        {
          path: 'partner-01',
          name: 'Customer',
          component: () => import('../views/Partner/Customer.vue'),
        },
        {
          path: 'partner-02',
          name: 'Supplier',
          component: () => import('../views/Partner/Customer.vue'), // 暂时使用同一个组件
        },
        {
          path: 'partner-03',
          name: 'AccountReconciliation',
          component: () => import('../views/Partner/Customer.vue'), // 暂时使用同一个组件
        },
        {
          path: 'partner-04',
          name: 'Blacklist',
          component: () => import('../views/Partner/Customer.vue'), // 暂时使用同一个组件
        },
        {
          path: 'partner-05',
          name: 'CreditAssessment',
          component: () => import('../views/Partner/Customer.vue'), // 暂时使用同一个组件
        },
        
        // 采购销售管理模块
        {
          path: 'ps-01',
          name: 'PurchaseOrder',
          component: () => import('../views/PurchaseSale/PurchaseOrder.vue'),
        },
        {
          path: 'ps-02',
          name: 'MaterialReceipt',
          component: () => import('../views/PurchaseSale/PurchaseOrder.vue'), // 暂时使用同一个组件
        },
        {
          path: 'ps-03',
          name: 'SalesOrder',
          component: () => import('../views/PurchaseSale/PurchaseOrder.vue'), // 暂时使用同一个组件
        },
        {
          path: 'ps-04',
          name: 'Shipment',
          component: () => import('../views/PurchaseSale/PurchaseOrder.vue'), // 暂时使用同一个组件
        },
        {
          path: 'ps-05',
          name: 'Settlement',
          component: () => import('../views/PurchaseSale/PurchaseOrder.vue'), // 暂时使用同一个组件
        },
         {
          path: 'Customerlist',
          name: 'Customerlist',
          component: () => import('../views/Customer/Customerlist.vue'),
        },
        {
          path: 'Supplierlist',
          name: 'Supplierlist',
          component: () => import('../views/Customer/Supplierlist.vue'),
        },
        {
          path: 'proType',
          name: 'proType',
          component: () => import('../views/Customer/proType.vue'),
        },
        {
          path: 'proShow',
          name: 'proShow',
          component: () => import('../views/Customer/proShow.vue'),
        },
         {
          path: 'proflowlist',
          name: 'proflowlist',
          component: () => import('../views/Customer/proflowlist.vue'),
        },
         {
          path: 'FlowAdd',
          name: 'FlowAdd',
          component: () => import('../views/Customer/FlowAdd.vue'),
        },
         {
          path: 'Orderslist',
          name: 'Orderslist',
          component: () => import('../views/Orderslist.vue'),
        },
         {
          path: 'OrdersAdd',
          name: 'OrdersAdd',
          component: () => import('../views/OrdersAdd.vue'),
        },
          {
          path: 'OrderXiang',
          name: 'OrderXiang',
          component: () => import('../views/OrderXiang.vue'),
        },
          {
          path: 'Dify',
          name: 'Dify',
          component: () => import('../views/Dify.vue'),
        },
           {
          path: 'Goodshow',
          name: 'Goodshow',
          component: () => import('../views/Goodshow.vue'),
        },
          {
          path: 'Verificationlist',
          name: 'Verificationlist',
          component: () => import('../views/Sales/Verificationlist.vue'),
        },
          {
          path: 'Procurelist',
          name: 'Procurelist',
          component: () => import('../views/Sales/Procurelist.vue'),
        },
          {
          path: 'Contractlist',
          name: 'Contractlist',
          component: () => import('../views/Sales/Contractlist.vue'),
        },
        {
          path: 'Phraselist',
          name: 'Phraselist',
          component: () => import('../views/Sales/Phraselist.vue'),
        },
        {
          path:'TeamTypeList',
          name:'TeamTypeList',
          component:()=>import('../views/Scheduling/TeamTypeList.vue'),
        },
        
        // 工具管理路由
        {
          path:'tool-01',
          name:'ToolLedger',
          component:()=>import('../views/Tool/ToolLedger.vue'),
        },
        {
          path:'tool-02',
          name:'ToolBorrow',
          component:()=>import('../views/Tool/ToolLedger.vue'), // 暂时使用同一个组件
        },
        {
          path:'tool-03',
          name:'ToolScrap',
          component:()=>import('../views/Tool/ToolLedger.vue'), // 暂时使用同一个组件
        },
        {
          path:'tool-04',
          name:'ToolLifeStats',
          component:()=>import('../views/Tool/ToolLedger.vue'), // 暂时使用同一个组件
        },
        {
          path:'tool-05',
          name:'ToolReport',
          component:()=>import('../views/Tool/ToolLedger.vue'), // 暂时使用同一个组件
        },
        
        // 库存管理其他路由
        {
          path:'TransferQuery',
          name:'TransferQuery',
          component:()=>import('../views/InventoryManagement/TransferQuery.vue'),
        },
        {
          path:'TransferAdd',
          name:'TransferAdd',
          component:()=>import('../views/InventoryManagement/TransferAdd.vue'),
        },
        {
          path:'TransferDetail/:id',
          name:'TransferDetail',
          component:()=>import('../views/InventoryManagement/TransferDetail.vue'),
        },
        {
          path:'dify',
          name:'dify',
          component:()=>import('../views/InventoryManagement/dify.vue'),
        },
        {
          path:'Weather',
          name:'Weather',
          component:()=>import('../views/Scheduling/Weather.vue'),
        },
        {
          path:'XunfeiChat',
          name:'XunfeiChat',
          component:()=>import('../views/Scheduling/Xunfei/XunfeiChat.vue'),
        }
      ]
    },
  ]
})
export default router
